//
//  LKCircleScrollView.h
//  LKCircleScrollViewDemo
//
//  Created by LIUKUN-PC on 16/7/12.
//  Copyright © 2016年 liukun. All rights reserved.
//

#import <UIKit/UIKit.h>
@class LKCircleScrollView;

@protocol LKCircleScrollViewDataSource <NSObject>

/** 有多少个视图 */
- (NSInteger)numberOfViewsInCircleScrollView:(LKCircleScrollView *)circleScrollView;

/** 视图来源 */
- (UIView *)circleScrollView:(LKCircleScrollView *)circleScrollView viewAtIndex:(NSInteger)index;

@end

@protocol LKCircleScrollViewDelegate <NSObject>

@optional

/** 点击View时调用  */
- (void)circleScrollView:(LKCircleScrollView *)circleScrollView didTapViewAtIndex:(NSInteger)index;

/** 当前索引改变时调用 */
- (void)circleScrollView:(LKCircleScrollView *)circleScrollView currentIndexDidChange:(NSInteger)currentIndex;

@end


@interface LKCircleScrollView : UIView

//可自定义视图风格，切勿改变代理及事件
@property (nonatomic, strong, readonly) UIPageControl *pageControl;
@property (nonatomic, strong, readonly) UIScrollView *scrollView;

/** 当前索引 */
@property (nonatomic, assign) NSInteger currentIndex;

/** 数据源代理 */
@property (nonatomic, weak) id<LKCircleScrollViewDataSource> dataSource;
/** 代理 */
@property (nonatomic, weak) id<LKCircleScrollViewDelegate> delegate;

/** 是否自动滚动 */
@property (nonatomic, assign) BOOL isAutoScroll;
/** 自动滚动时间间隔 */
@property (nonatomic, assign) NSTimeInterval scrollTimeInterval;

/** 重载数据 */
- (void)reloadData;

@end
